package com.fxp.project.jiuselu.web.models.order.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

@Data
@EqualsAndHashCode(callSuper = false)
@TableName("jsl_user_balance")
public class JslUserBalance implements Serializable {

    /**
     * id
     */
//    @TableId("id")
    private Long id;
    /**
     * 收入类型 1客户提成2业务员提成3提现4佣金奖励
     */
    private Integer type;
    /**
     * 收益金额
     */
    private BigDecimal income;
    /**
     * 用户余额
     */
    private BigDecimal balance;
    /**
     * 创建时间
     */
    private LocalDateTime createTime;
    /**
     * 创建人
     */
    private Long createBy;
    /**
     * 创建人手机号
     */
    private String createPhone;
    /**
     * order_id 订单id
     */
    private String orderId;
    /**
     * 受益人
     */
    private Long benefitUser;
    /**
     * 头像url
     */
    private String imgUrl;

    /**
     * 拒绝理由
     */
    private String rejectReason;

    public JslUserBalance() {
    }

    /**
     *
     * @param type 收入类型 1客户提成2业务员提成3提现4佣金奖励
     * @param income 收益金额
     * @param balance 用户余额
     * @param createBy 创建人
     * @param createPhone 创建人手机号
     * @param orderId 订单id 可以为null
     */
    public JslUserBalance(Integer type, BigDecimal income, BigDecimal balance, Long createBy, String createPhone, String orderId,Long benefitUser,String imgUrl) {
        this.type = type;
        this.income = income;
        this.balance = balance;
        this.createBy = createBy;
        this.createPhone = createPhone;
        this.orderId = orderId;
        this.createTime=LocalDateTime.now();
        this.benefitUser=benefitUser;
        this.imgUrl=imgUrl;
    }
}
